package com.ozo.cloud.system.feign;

import cn.hutool.core.bean.BeanUtil;
import com.ozo.cloud.api.system.dto.SysLoginLogDTO;
import com.ozo.cloud.api.system.feign.SysLoginLogFeignClient;
import com.ozo.cloud.common.base.model.ResultVO;
import com.ozo.cloud.system.entity.SysLoginLog;
import com.ozo.cloud.system.service.ISysLoginLogService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RestController;

/**
 * 登录日志服务调用
 *
 * @author qiangesoft
 * @date 2024-09-11
 */
@RequiredArgsConstructor
@RestController
public class LoginLogFeignFeignController implements SysLoginLogFeignClient {

    public final ISysLoginLogService sysLoginLogService;

    @Override
    public ResultVO<Void> add(SysLoginLogDTO loginLogDTO) {
        SysLoginLog sysLoginLog = BeanUtil.copyProperties(loginLogDTO, SysLoginLog.class);
        sysLoginLogService.save(sysLoginLog);
        return ResultVO.success();
    }

}
